<?php
if(isset($_POST["order_submit"])){
	if(!empty($_POST["name"]) && !empty($_POST["address"]) && !empty($_POST["phone"]) && !empty($_POST["email"]) && !empty($_POST["items"])){
		$headers = "MIME-Version: 1.0" . "\r\n";
		$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
		$headers .= 'From: Buci Pizzéria <bucipizzeria@gmail.com>' . "\r\n";

		$message = "
					<html><body>
					<h1>Rendel&eacute;s</h1>
					<h3>A <a href='http://bucipizzeria.hu' target='_blank'>Buci Pizz&eacute;ria</a> oldalon leadott rendel&eacute;s adatai:</h3>
					<table border='1' width='60%'>
						<tr><td>N&eacute;v:</td><td>".$_POST["name"]."</td></tr>
						<tr><td>C&iacute;m:</td><td>Szeged, ".$_POST["address"]."</td></tr>
						<tr><td>Telefon:</td><td>".$_POST["phone"]."</td></tr>
						<tr><td>E-mail c&iacute;m:</td><td>".$_POST["email"]."</td></tr>
						<tr><td>Megjegyz&eacute;s</td><td>".$_POST["note"]."</td></tr>
					</table>
					".$_POST["items"]."
					<h3>Rendel&eacute;st csak d&eacute;lel&#337;tt 10:30-t&#337;l este 22:00-ig vesz&uuml;nk fel!</h3>
					</body></html>
					";

		//print $message;
		mail($_POST["email"].", bucipizzeria@gmail.com, buci.pizzeria.rendeles@gmail.com", "Rendelés", $message, $headers);
		//mail("bucipizzeria@gmail.com", "Rendelés", $message, $headers);
		//mail("maniakus.munkas@gmail.com, buci.pizzeria.rendeles@gmail.com", "Rendelés", $message, $headers);
		header("Location: http://bucipizzeria.hu/index.php?url=&done=&empty=");
		//$this->redirect(implode("/", $this->url)."&done=&empty=");
	}
}
//var_dump($_POST);
?>